JNSAR-DPJNSAR:
Take Last 5 days, 5 periods High, Low and Close EMA. We shall have 15 such EMAs. Its average is JNSAR.
EMAs:
Plot High and Low EMAs for the 5 periods.
If close is above high EMA, fill the band with green color, if close is below low ema, fill the band with red color. If close is between high and low EMAs, fill the band with
grey color.
Display the indicator in a Day and Week and Hour time frames.
How to use:
When you see a green color band, there are high chances of price to move higher. If you see a red color band, there are high chances of the price to move lower. If you
see more grey color, there are high chances of the price to move sideways.
Disclaimer:
This indicator is for education or study purpose. There is no recommendation to buy or sell any scrip here. Take your own risks and rewards and you are only the
responsible for any outcome after using this indicator.
Cerca negli script per "high low"
Mean Shift Pivot ClusteringCore Concepts
According to Jeff Greenblatt in his book "Breakthrough Strategies for Predicting Any Market", Fibonacci and Lucas sequences are observed repeated in the bar counts from local pivot highs/lows. They occur from high to high, low to high, high to low, or low to high. Essentially, this phenomenon is observed repeatedly from any pivot points on any time frame. Greenblatt combines this observation with Elliott Waves to predict the price and time reversals. However, I am no Elliottician so it was not easy for me to use this in a practical manner. I decided to only use the bar count projections and ignore the price. I projected a subset of Fibonacci and Lucas sequences along with the Fibonacci ratios from each pivot point. As expected, a projection from each pivot point resulted in a large set of plotted data and looks like a huge gong show of lines. Surprisingly, I did notice clusters and have observed those clusters to be fairly accurate.
Fibonacci Sequence: 1, 2, 3, 5, 8, 13, 21, 34...
Lucas Sequence: 2, 1, 3, 4, 7, 11, 18, 29, 47...
Fibonacci Ratios (converted to whole numbers): 23, 38, 50, 61, 78, 127, 161...
Light Bulb Moment
My eyes may suck at grouping the lines together but what about clustering algorithms? I chose to use a gimped version of Mean Shift because it doesn't require me to know in advance how many lines to expect like K-Means. Mean shift is computationally expensive and with Pinescript's 500ms timeout, I had to make due without the KDE. In other words, I skipped the weighting part but I may try to incorporate it in the future. The code is from Harrison Kinsley . He's a fantastic teacher!
Usage
Search Radius: how far apart should the bars be before they are excluded from the cluster? Try to stick with a figure between 1-5. Too large a figure will give meaningless results.
Pivot Offset: looks left and right X number of bars for a pivot. Same setting as the default TradingView pivot high/low script.
Show Lines Back: show historical predicted lines. (These can change)
Use this script in conjunction with Fibonacci price retracement/extension levels and/or other support/resistance levels. If it's no where near a support/resistance and there's a projected time pivot coming up, it's probably a fake out.
Notes
Re-painting is intended. When a new pivot is found, it will project out the Fib/Lucas sequences so the algorithm will run again with additional information.
The script is for informational and educational purposes only.
Do not use this indicator by itself to trade!
Volume Pace & Pressure TableHave you ever wanted to know if a particular tickers volume is above or below average while still in the trading day? This indicator displays an easy-to-read table that informs the user exactly what is occurring in intraday volume. And a whole lot more!
Description
This indicator displays a variable table with either two or three columns and always three rows. It packs everything a user needs to know about volume in one small table. The table shows:
Current trading days volume
Average daily volume
Volume Pace
Volume Pressure (Buying & Selling)
Volume Pace
Volume Pace is a mathematical calculation invented by the author, Infinity_Trading . The problem was to figure out a way to know if the current days volume was below average or above average while still in the trading day. Calculations like Percent Daily Volume don’t work during the intraday trading hours. For example, say SPY has a 20-day volume average of 100 million shares. If in the first hour SPY has only traded 10 million shares then dividing the current volume into the average daily volume doesn’t tell the user anything when there is still 5.5 hours of trading left in the trading day. There had to be a better way! The solution was to chop up the trading day into evenly divisible time periods (i.e. <= 30 minutes). The Volume Pace algorithm takes the average daily volume and chops it up into small time periods based upon the charts current timeframe. This is the average volume per smaller time period. Then use the current days volume and the number of time periods that have occurred in the trading day so far (at the current moment in time i.e. the current candlestick) to form a calculation that returns the volume above or below the average volume up to that point in time.
Volume Pace Equations
Intraday Vol. Pace = Today’s Current Vol. - ( ( Average Daily Vol. / Time periods in trading day ) * Time periods that have occurred so far in trading day )
Postday Vol. Pace = Today’s Trading Vol. - Average Daily Vol.
^ Vol. = Volume (because TradingViews pine tags are dumb)
Volume Pace Definitions
Volume Pace is the difference in cumulative volume between todays current volume and the average daily volume up to same time of the day
Volume Pace Usage
If the Volume Pace is a positive number then it means that up to the current trading time the volume is that amount greater than the average daily volume over that same intraday time span.
If the Volume Pace is a negative number then it means that up to the current trading time the volume is that amount smaller than the average daily volume over that same intraday time span.
If the Volume Pace is positive during the intraday then the volume is on track to be an above average volume trading day.
If the Volume Pace is negative during the intraday then the volume is on track to be a below average volume trading day.
The Percent Volume Pace is the percent increase or decrease of the current volume compared to the average volume up to the same time of day. Or the Percent Volume Pace is the Volume Pace expressed as a percentage.
After the trading day is complete the Volume Pace will be the difference between the Daily Volume and the Average Daily Volume. And the same thing applies to the Percent Volume Pace.
Volume Pressure
The author, Infinity_Trading, did not invent the calculations for Volume Pressure but the definitions and explanations of Volume Pressure are their own creations. In specific terms, Volume Pressure is a mathematical calculation that uses the direction and distances of individual candlesticks bodies and wicks to assign a numerical value to volume.
buyingPressure = vol * (close - low) / (high - low)
sellingPressure = vol * (high - close) / (high - low)
^ vol = Volume (because TradingViews pine tags are dumb)
The author wants to make clear that volume “pressure” isn’t a real thing. Trades in any market require a buyer and a seller. So there is always an equal number of buyers and sellers. Thus, the idea that there are more buyers or more sellers isn’t rooted in reality. BUT the author believes that the calculation and understanding of “volume pressure” takes a very complex subject (price moment in a market) and condenses into something that intuitively makes sense to humans (pressure) and places it onto something that is already on everyone’s charts (volume bars).
The calculation for Buying Pressure is really calculating the upward distance between the low and the close of the candle. While Selling Pressure is measuring the downward distance from the high to the close. And both are using volume bars to express these measurements. So if an individual candle goes down then the red Selling Pressure will be more on the stacked bar chart than the green Buying Pressure. And vice versa for candles that went up. If a Volume Pressure bar is completely one color then it means, for a downward candle, the low and close were equivalent, and for an upward candle, the high and the close were the same. Lastly, the Buying & Selling Pressure will always add up to 100%.
Inputs and Style
In the Input section the user can set the number of days to use for all of the average calculations. All aspects of the table can be controlled. The background color, text color, border widths, and border colors. Also, the table can be moved to 9 unique locations around the chart for complete user control. Also, the user can use their cursor to hover over each cell in the table to reveal a tooltip definition of the calculation in the cell.
Special Notes
The volume table won’t display when the chart timeframe is weekly or monthly because the logic uses “daily” volume.
The Volume Pace column in the table disappears when the timeframe is greater than 30 minutes. Because for Volume Pace to work the time periods must be equally divisible into 6.5 hours (the duration of trading day).
HersG High Low Bar Charts Layout
Hello friends,
The following indicator will create a new form of chart layout in High & Low as candle-like full bars instead of Open and Close. There are no wicks, only full bars highlighting High and Low of the select time frame. Two dots inside a bar will represent Open (Red dot) and Close (Green dot).
How can it help you as a trader?
High and Low candle-like bars will clear the noise from charts in identifying support & resistance, higher-highs and lower-lows will be clearly visible thus helping you make trades.
First add the indicator and then hover the mouse pointer over the ticker in the charts and click on the “eye-shaped” symbol to hide the candlesticks chart pattern.
The type of chart layout is standard charts. Data are not re-calculated or manipulated.
Regards!
Pythagorean Means of Moving AveragesDESCRIPTION
Pythagorean Means of Moving Averages
1. Calculates a set of moving averages for high, low, close, open and typical prices, each at multiple periods.
Period values follow the Fibonacci sequence.
The "short" set includes moving average having the following periods: 5, 8, 13, 21, 34, 55, 89, 144, 233, 377.
The "mid" set includes moving average having the following periods: 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610, 987, 1597.
The "long" set includes moving average having the following periods: 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610, 987, 1597, 2584, 4181.
2. User selects the type of moving average: SMA, EMA, HMA, RMA, WMA, VWMA.
3. Calculates the mean of each set of moving averages.
4. User selects the type of mean to be calculated: 1) arithmetic, 2) geometric, 3) harmonic, 4) quadratic, 5) cubic. Multiple mean calculations may be displayed simultaneously, allowing for comparison.
5. Plots the mean for high, low, close, open, and typical prices.
6. User selects which plots to display: 1) high and low prices, 2) close prices, 3) open prices, and/or 4) typical prices.
7. Calculates and plots a vertical deviation from an origin mean--the mean from which the deviation is measured.
8. Deviation = origin mean x a x b^(x/y)/c.
9. User selects the deviation origin mean: 1) high and low prices plot, 2) close prices plot, or 3) typical prices plot.
10. User defines deviation variables a, b, c, x and y.
Examples of deviation:
a) Percent of the mean = 1.414213562 = 2^(1/2) = Pythagoras's constant (default).
b) Percent of the mean = 0.7071067812 = = = sin 45˚ = cos 45˚.
11. Displaces the plots horizontally +/- by a user defined number of periods.
PURPOSE
1. Identify price trends and potential levels of support and resistance.
CREDITS
1. "Fibonacci Moving Average" by Sofien Kaabar: two plots, each an arithmetic mean of EMAs of 1) high prices and 2) low prices, with periods 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610, 987, 1597, 2584, 4181.
2. "Solarized" color scheme by Ethan Schoonover.
Fr3d0's Volume Profile Visible RangeLow level implementation
At the core of VPVR there’s a concept called “bucketization”.
Question : what is bucketization?
Answer : bucketization consists of identifying metrics with high predictive power and combine them appropriately.
I think this is a problem of bucketization because what the VPVR does is to take a price range, divide it into buckets and fill them up with the volume that was produced in each bucket’s range over the given period.
The more we divide our price range the finer the resolution, but also the less significant each bucket will become.
The steps are :
1. Get the price range with min and max over the give period;
2. Divide the range into buckets;
3. Loop over each candle of the given period and proportionally assign volume to one or more bucket.
Question : how to assign volume to buckets?
Answer : we need to calculate the right amount to add to each bucket for each candle. If 20% of a candle lies on a bucket then that bucket needs to have 20% of the volume of that candle, the rest 80% belongs to other buckets.
To get the percentage of a candle on a given bucket we have to find the price range of the candle contained within the bucket, then divide that amount by the entire length of the candle.
How to bucketize
Question : what are the formulas of A, B, C and Target respectively?
Answer :
- A = Max(candle_high, bucket_top) - Min(candle_low, bucket_bottom);
- B = Max(candle_high, bucket_top) - Min(candle_high, bucket_top);
- C = Max(candle_low, bucket_bottom) - Min(candle_low, bucket_bottom);
- Target = A - B - C.
Now that we now how to calculate the price range belonging to each bucket we need to calculate a percentage of volume to fill the bucket with.
The formula is trivially simple :
Volume * Target / (candle_high - candle_low).
Question : can we distinguish between buy volume and sell volume? If so, how?
Answer : yes we can and the following paragraph will teach you how.
Put it simply we can use the difference between the extremes of a candle (low and high) and its close price to get the buy and sell volumes.
The formulas for that are :
- Buy volume = Volume * (close - low) / (high - low);
- Sell volume = Volume * (high - close) / (high - low).
I know this is rather simplicistic but it makes sense.
Closing thoughts
This script is a working progress and I’m going to give more details if necessary, just let me know in the comments down below.
Qullamaggie Breakout V2After publishing the Qullamaggie Breakout script and seeing that it had some decent results, I wanted to explore it a bit further. There were a few things I didn't like about that methodology that didn't really jive with the way I like to trade. So what I did was combined the Breakout Trend Follower strategy I had been using for entries with the Qullamaggie strategy for trailing stops once in profit. The results seem pretty good to me and an approach that fits my personality and something I can actually trade. Typically better profit than the Breakout Trend Follower by giving more room for your winners to run, while still protecting your entries by moving up the trailing stop until you are in profit, all while taking less trades, so that's great.
Everything is done with stop orders. So you set your buy stop at the recent swing high point and wait for a breakout. Once in a position you set your sell stop at the recent swing low point. The most recent swing high and low are shown on the chart for easy reference with the blue and orange horizontal lines. Once in a trade, trail your sell stop after a new swing low is registered (shown by the thicker orange stop line). Once you are in profit, leave that hard stop level there (the orange line will stay there helping you). Now, you wait for price to cross a Moving Average of your choosing (default is Daily 10 MA). Once the bar crosses that moving average, you move your stop to the low of that candle (shown by the blue stop line) and trail your stop along every crossing of the moving average until the trend changes and takes out your stop. So managing this trade is pretty easy...just wait for the stop lines to move and move your stop with them. It's a great way to trade when you can't be at your computer all the time because the stop orders take care of execution on both buy and sell side. If you use a daily timeframe for your moving averages (the default), you really only need to move stops around about once a day, so is a good part time trader's strategy in my opinion.
The best opportunities will come by scanning for stocks in the longer term timeframe of your moving averages. Wait for a consolidation on that timeframe so the anticipated breakout has some room to run. Once you've identified a good candidate, zoom in to your lower timeframe where the swing highs/lows will act as your entry and exit points, all while keeping the moving averages consistent between timeframes.
Hope you guys find it useful.
A few options available:
- Choose any timeframe for your moving averages, while using swing high/low points on intraday charts.
- Choose one of two moving averages shown for your trailing stops (default 10 and 20 MA).
- Choose to use the third moving average as a filter for keeping you out of trades that are below it (trading with the trend).
- Use the charts resolution candle or the moving average resolution candle for the moving average trailing stop.
- Only take trades where your buy level minus stop level is below a % of the Average Daily Range (ADR). This allows you to potentially have better risk/reward. I added a little table that shows the ADR of the stock/ticker as well as the range between the recent buy and sell levels (shown by the orange and blue horizontal lines) for easy reference.
Detrended Rhythm Oscillator (DRO)How to detect the current "market beat" or market cycle?
A common way to capture the current dominant cycle length is to detrend the price and look for common rhythms in the detrended series. A common approach is to use a Detrended Price Oscillator (DPO). This is done in order to identify and isolate short-term cycles.
A basic DPO description can be found here:
www.tradingview.com
Improvements to the standard DPO
The main purpose of the standard DPO is to analyze historical data in order to observe cycle's in a market's movement. DPO can give the technical analyst a better sense of a cycle's typical high/low range as well as its duration. However, you need to manually try to "see" tops and bottoms on the detrended price and measure manually the distance from low-low or high-high in order to derive a possible cycle length.
Therefore, I added the following improvements:
1) Using a DPO to detrend the price
2) Indicate the turns of the detrended price with a ZigZag lines to better see the tops/bottoms
3) Detrend the ZigZag to remove price amplitude between turns to even better see the cyclic turns ("rhythm")
4) Measure the distance from last detrended zigzag pivot (high-high / low-low) and plot the distance in bars above/below the turn
Now, you can clearly see the rhythm of the dataset indicated by the Detrended Rhythm Oscillator including the exact length between the turns. This makes the procedure to "spot" turns and "measure" distance more simple for the trader.
How to use this information
The purpose is to check if there is a common rhythm or beat in the underlying dataset. To check that, look for recurring pattern in the numbers. E.g. if you often see the same measured distance, you can conclude that there is a major dominant cycle in this market. Also watch for harmonic relations between the numbers. So in the example above you see the highlighted cluster of detected length of around 40,80 and 120. There three numbers all have a harmonic relation to 40.
Once you have this cyclic information, you can use this number to optimize or tune technical indicators based on the current dominant cycle length. E.g. set the length parameter of a technical indicator to the detected harmonic length with the DRO indicator.
Example Use-Case
You can use this information to set the input for the following free public open-source script:
Disclaimer
This is not meant to be a technical indicator on its own and the derived cyclic length should not be used to forecast the next turn per se. The indicator should give you an indication of the current market beat or dominant beats which can be use to further optimize other oscillator or trading related settings.
Options & settings
The indicator allows to plot different versions. It allows to plot the original DPO, the DRO with ZigZag lines, the DRO with detrended ZigZag lines and length labels on/off. You can turn on or off these version in the indicator settings. So you can tweak it visually to your own needs.
Intrangle - Straddle / StrangleIntrangle is an indicator to assist Nifty / Bank Nifty Option Writers / Sellers to identify the PE / CE legs to Sell for Straddle and Strangle positions for Intraday.
Basic Idea : (My Conclusion for making this Indicator)
1) Last 10 Years data says Nifty / Bank Nifty More than 66% of times Index are sideways or rangebound (within 1% day) .
2) Mostly, First one hour high and low working as good support and resistance.
Once First one hour complete, this indicator will show Strangle High (CE), Strangle Low (PE) and Straddle (CE/PE).
Straddle:
If you want to do straddle strategy, sell at the money strike (CE/PE) when price comes near to the straddle line (black line),
Strangle:
If you want to do Strangle strategy, sell Strangle High (CE) and Strangle Low (PE) when price comes near to the straddle line (black line). Both Strangle High and Low will be out of the money when price near to the straddle line (black line).
Adjustment: option adjustment to be done based on the price movement. Adjustment purely up to the user / trader.
Note1: If price not comes to near straddle line after first hour, better to stay light…
Note2: If first hour not giving wide High / Low, don’t use strangle strike based on this indicator. Straddle can be done any day with require adjustment / hedge. This Indicator is purely for education purpose, user / trader has to be back-tested before their start using it.
This indicator will work in Nifty / Bank Nifty only. Best Time frames are 3/5/15 Mins. This is purely made for Intraday
Happy Trading 😊
Euler Cubes - CubᵋI give you the "Euler Cubes", inspired by the mathematical number 'e' (Euler's number).
It is suggested (fibonacci ratios analogy) that price/e ratio can give Support/Resistance area's.
The first cube is made by a low/high of choice, for example:
You set the 'source low'/'source high' in position:
Then you choose the 'e ratio' (x times 'e')
This multiplies the distance 'high-low' times '0.271828' times 'the set number' .
For example, choosing 5 gives 5 x 0.271828 = 1.35914, the distance 'high-low' hereby multiplied by 1.35914, the following cubes multiply the previous distance by 1.35914.
(Settings below 5 will give cubes smaller than the 'high-low' distance)
In the case of x times 'e' = 5:
You can extend the lines:
Now you can give it an angle:
Do mind, using it over very little bars and using an angle can cause some lines to not align as intended, because for now, it is not possible to plot in between bars.
There are also 'Euler' SMA and EMA available with following length's:
27, 54, 82,109, 136, 163, 190 and 217
Cheers!
ADX with SignalsThis indicator basicly usind ADX ( Average Directional Index )
ADX can show us how trend is strong
ADX below 20: the market is currently not trending
ADX crosses above 20: signifies that a new trend is emerging. Traders may start placing sell or buy orders in the direction of the price movement.
ADX between 20 and 40: When the ADX is growing between 20 and 40 it is considered as a confirmation of an emerging trend. Traders should use this opportunity to buy or short sell in the trend's direction.
ADX above 40: the trend is very strong.
ADX crosses 50: the trend is extremely strong.
ADX crosses 70: a very rare occasion, which is called a “Power Trend.”
If we use ADX with DI+ and DI+ indactor can tell us to buy.
How can we calculate this all?
Directional Movement (DI) is defined as the largest part of the current period’s price range that lies outside the previous period’s price range. For each period calculate:
+DI = positive or plus DI = High - Previous High
-DI = negative or minus DI = Previous Low - Low
The smaller of the two values is reset to zero, i.e., if +DI > -DI , then -DI = 0. On an inside bar (a lower high and higher low), both +DI and -DI are negative values, so both get reset to zero as there was no directional movement for that period.
The True Range ( TR ) is calculated for each period, where:
TR = Max of ( High - Low ), ( High -PreviousClose ), ( PreviousClose - Low )
The +DI , -DI and TR are each accumulated and smoothed using a custom smoothing method proposed by Wilder. For an n period smoothing, 1/n of each period’s value is added to the total each period, similar to an exponential smoothing:
+DIt = (+DIt-1 - (+DIt-1 / n)) + (+DIt)
-DIt = (-DIt-1 - (-DIt-1 / n)) + (-DIt)
TRt = (TRt-1 - (TRt-1 / n)) + ( TRt )
Compute the positive/negative Directional Indexes, +DI and -DI , as a percentage of the True Range:
+DI = ( +DI / TR ) * 100
-DI = ( -DI / TR ) * 100
Compute the Directional Difference as the absolute value of the differences: DIdiff = | (( +DI ) - ( -DI )) |
Sum the directional indicator values: DIsum = (( +DI ) + ( -DI )) .
Calculate the Directional Movement index: DX = ( DIdiff / DIsum ) * 100 . The DX is always between 0 and 100.
Finally, apply Wilder’s smoothing technique to produce the final ADX value:
ADXt = ( ( ADXt-1 * ( n - 1) ) + DXt ) / n
When indicator tell us to buy?
If when DI+ crosses DI- and ADX is bigger than DI- indicator tell us to buy.
1D Low/High MA + Least Square Mean (3 indicators in 1)This indicator is a combination of 3 public indicators being:
* a standard Simple Moving Average with the source as the candle low & length of 2
* a standard Simple Moving Average with the source as the candle high & length of 2
* the Least Square Mean with a source of high + low /2 and length of 9
This combo was inspired by Tyler Coates who crafted EMASAR.
He regularly uses the a SMA with source of Low / High and length of 2 for defining trading daily ranges as well as the Least Square Mean for calculations in the his trading which he teaches via youtube.
I hope this indicator will reduce time spent on setting up charts.
Trading Ideas - Chart Champions Value - Points of Interest Trading Ideas is based on having visual Points of Interest.
The indicator displays:
- dOpen : Daily Open
- dPOC: Developing Point of Control
- pdPOC : Previous Day Point of Control
- dbyPOC : Day Before Yesterday Point of Control
Initial Balance (High, low, mid points for the first hour (UTC 0000)
- IB High : Initial Balance High
- IB Mid : Initial Balance Middle
- IB Low : Initial Balance Low
Chart Champions Value ( CCV ) is based on Daniel - Chart Champions theory explained in his educational videos.
That if the previous day is a range day and price action (PA) closes:
Above the previous days Value Area High (pdVAH) then there is an 80% chance of it retracing back to previous days Value Area Low (pdVAL)
Below the previous days Value Area Low (pdVAL) then there is an 80% chance of it going back up to the previous days Value Area High (pdVAH)
The CCV check can be ticked on and off for a quick visual to see if the setup could potentially be in play (if green then CCV could be play for that day).
Settings/Configuration
The calculated Value Area (VA) can be amended.
It is recommend to change the resolution to that of your symbol. For example BTC resolution 1, XRP resolution 0.00001.
As seen below having key Points of Interest can make you think twice before going into a trade:
My thanks go to:
ahancock for allowing usage of his script.
AnyDozer and Bjorn Mistiaen on Stack Overflow for all their assistance.
Any feedback will be gratefully received.
Pivot Points (Daily, Weekly, Monthly)Pivot point: P = (High + Low)/2
First support: S1 = Low
Second support, S2 = Low - 2 * (High - Low)
First resistance: R1 = High
Second resistance, R2 = High + 2 * (High - Low)
White Line: Pivot Point
Gleen Line(Thin Line): Support 1
Green Line(Thick Line): Support 2
Red Line(Thin Line): Resistance 1
Red Line (Thick Line): Resistance 2
You can adjust it to daily, weekly or monthly indicators, daily for intraday trading (1minute, 1hour etc.), weekly and monthly for day/swing trading, monthly for weekly trades. I plot the graph with steplines since I think they can show the differences of pivots from time to time more clearly, you are free to change to other plot styles like circles or regular lines if you want to. Please like this script, and let me know any questions, thanks.
MACD-X, More Than MACD by DGTMoving Average Convergence Divergence – MACD
The most popular indicator used in technical analysis, the moving average convergence divergence (MACD), created by Gerald Appel. MACD is a trend-following momentum indicator, designed to reveal changes in the strength, direction, momentum, and duration of a trend in a financial instrument’s price
Historical evolution of MACD,
- Gerald Appel created the MACD line,
- Thomas Aspray added the histogram feature to MACD
- Giorgos E. Siligardos created a leader of MACD
MACD employs two Moving Averages of varying lengths (which are lagging indicators) to identify trend direction and duration. Then, MACD takes the difference in values between those two Moving Averages (MACD Line) and an EMA of those Moving Averages (Signal Line) and plots that difference between the two lines as a histogram which oscillates above and below a center Zero Line. The histogram is used as a good indication of a security's momentum.
Mathematically expressed as;
macd = ma(source, fast_length) – ma(source, slow_length)
signal = ma(macd, signal_length)
histogram = macd – signal
where exponential moving average (ema) is in common use as a moving average (ma)
fast_length = 12
slow_length = 26
signal_length = 9
The MACD indicator is typically good for identifying three types of basic signals ;
Signal Line Crossovers
A Signal Line Crossover is the most common signal produced by the MACD. On the occasions where the MACD Line crosses above or below the Signal Line, that can signify a potentially strong move. The standard interpretation of such an event is a recommendation to buy if the MACD line crosses up through the Signal Line (a "bullish" crossover), or to sell if it crosses down through the Signal Line (a "bearish" crossover). These events are taken as indications that the trend in the financial instrument is about to accelerate in the direction of the crossover.
Zero Line Crossovers
Zero Line Crossovers occur when the MACD Line crossed the Zero Line and either becomes positive (above 0) or negative (below 0). A change from positive to negative MACD is interpreted as "bearish", and from negative to positive as "bullish". Zero crossovers provide evidence of a change in the direction of a trend but less confirmation of its momentum than a signal line crossover
Divergence
Divergence is another signal created by the MACD. Simply, divergence occurs when the MACD and actual price are not in agreement. A "positive divergence" or "bullish divergence" occurs when the price makes a new low but the MACD does not confirm with a new low of its own. A "negative divergence" or "bearish divergence" occurs when the price makes a new high but the MACD does not confirm with a new high of its own. A divergence with respect to price may occur on the MACD line and/or the MACD Histogram
Moving Average Crossovers , another hidden signal that MACD Indicator identifies
Many traders will watch for a short-term moving average to cross above a longer-term moving average and use this to signal increasing upward momentum. This bullish crossover suggests that the price has recently been rising at a faster rate than it has in the past, so it is a common technical buy sign. Conversely, a short-term moving average crossing below a longer-term average is used to illustrate that the asset's price has been moving downward at a faster rate and that it may be a good time to sell.
Moving Average Crossovers in reality is Zero Line Crossovers, the value of the MACD indicator is equal to zero each time the two moving averages cross over each other. For easy interpretation by trades, Zero Line Crossovers are simply described as positive or negative MACD
False signals
Like any forecasting algorithm, the MACD can generate false signals. A false positive, for example, would be a bullish crossover followed by a sudden decline in a financial instrument. A false negative would be a situation where there is bearish crossover, yet the financial instrument accelerated suddenly upwards
What is “MACD-X” and Why it is “More Than MACD”
In its simples form, MACD-X implements variety of different calculation techniques applied to obtain MACD Line, ability to use of variety of different sources , including Volume related sources, and can be plotted along with MACD in the same window and all those features are available and presented within a single indicator, MACD-X
Different calculation techniques lead to different values for MACD Line, as will further discuss below, and as a consequence the signal line and the histogram values will differentiate accordingly. Mathematical calculation of both signal line and the histogram remain the same.
Main features of MACD-X ;
1- Introduces different proven techniques applied on MACD calculation , such as MACD-Histogram, MACD-Leader and MACD-Source, besides the traditional MACD (MACD-TRADITIONAL)
• MACD-Traditional , by Gerald Appel
It is the MACD that we know, stated as traditional just to avoid confusion with other techniques used with this study
• MACD-Histogram , by Thomas Aspray
The MACD-Histogram measures the distance between MACD and its signal line (the 9-day EMA of MACD). Aspray developed the MACD-Histogram to anticipate signal line crossovers in MACD. Because MACD uses moving averages and moving averages lag price, signal line crossovers can come late and affect the reward-to-risk ratio of a trade. Bullish or bearish divergences in the MACD-Histogram can alert chartists to an imminent signal line crossover in MACD
The MACD-Histogram represents the difference between MACD and its 9-day EMA, the signal line. Mathematically,
macdx = macd - ma(macd, signal_length)
Aspray's contribution served as a way to anticipate (and therefore cut down on lag) possible MACD crossovers which are a fundamental part of the indicator.
Here come a question, what if repeat the same calculations once more (macdh2 = macdh - ma(macdh, signal_length), will it be even better, this question will remain to be tested
• MACD-Leader , by Giorgos E. Siligardos, PhD
MACD Leader has the ability to lead MACD at critical situations. Almost all smoothing methods encounter in technical analysis are based on a relative-weighted sum of past prices, and the Leader is no exception. The concealed weights of MACD Leader are such that more relative weight is used in the more recent prices than the respective weights used by the components of MACD. In effect, the Leader expresses more changes in average price dynamics for the recent price movement than MACD, thus eventually leading MACD, especially when significant trend changes are about to take place.
Siligardos creates two less-laggard moving averages indicators in its formula using the same periods as follows
Indicator1 = ma(source, fast_length) + ma(source - ma(source, fast_length), fast_length)
Indicator2 = ma(source, slow_length) + ma(source - ma(source, slow_length), slow_length)
and then take the difference:
Indicator1 - Indicator2
The result is a new MACD Leader indicator
macdx = macd + ma(source - fast_ma, fast_length) - ma(source - slow_ma, slow_length)
• MACD-Source , a custom experimental interpretation of mine ,
MACD Source, presents an application of MACD that evaluates Source/MA Ratio, relatively with less lag, as a basis for MACD Line, also can be expressed as source convergence/divergence to its moving average. Among the various techniques for removing the lag between price and moving average (MA) of the price, one in particular stands out: the addition to the moving average of a portion of the difference between the price and MA. MACD Source, is based on signal length mean of the difference between Source and average value of shot length and long length moving average of the source (Source/MA Ratio), where the source is actual value and hence no lag and relatively less lag with the average value of moving average of the source . Mathematically expressed as,
macdx = ma(source - avg( ma(source, fast_length), ma(source, slow_length) ), signal_length)
MACD Source provides relatively early crossovers comparing to MACD and better momentum direction indications, assuming the lengths are set to same values
For further details, you are invited to check the following two studies, where the first seeds were sown of the MACD-Source idea
Price Distance to its Moving Averages study, adapts the idea of “Prices high above the moving average (MA) or low below it are likely to be remedied in the future by a reverse price movement", presented in an article by Denis Alajbeg, Zoran Bubas and Dina Vasic published in International Journal of Economics, Commerce and Management
First MACD like interpretation comes with the second study named as “ P-MACD ”, where P stands for price, P-MACD study attempts to display relationship between Price and its 20 and 200-period moving average. Calculations with P-MACD were based on price distance (convergence/divergence) to its 200-period moving average, and moving average convergence/divergence of 20-period moving average to 200-period moving average of price.
Now as explained above, MACD Source is a one adapted with traditional MACD, where Source stands for Price, Volume Indicator etc, any source applicable with MACD concept
2- Allows usage of variety of different sources, including Volume related indicators
The most common usage of Source for MACD calculation is close value of the financial instruments price. As an experimental approach, this study will allow source to be selected as one of the following series;
• Current Close Price (close)
• Average of High, Low, and Close Price (hlc3)
• On Balance Volume (obv)
• Accumulation Distribution (accdist)
• Price Volume Trend (pvt)
Where,
-Current Close Price and Average of High, Low, and Close Price are price actions of the financial instrument
- Accumulation Distribution is a volume based indicator designed to measure underlying supply and demand
- On Balance Volume (OBV) , is a momentum indicator that measures positive and negative volume flow
- Price Volume Trend (PVT) is a momentum based indicator used to measure money flow
3- Can be plotted along with MACD in the same window using the same scaling
Default setting of MACD-X will display MACD-Source with Current Close Price as a source and traditional MACD can be plotted eighter as a companion of MACD-X or can be selected to be plotted alone.
Applying both will add ability to compare, or use as a confirmation of one other
In case, traditional MACD Is plotted along with MACD-X to avoid misinterpreting, the lines plotted, the area between MACD-X Line and Signal-X Line is highlighted automatically, even if the highlight option not selected. Otherwise highlight will be applied only if that option selected
4- 4C Histogram
Histogram is plotted with four colors to emphasize the momentum and direction
5- Customizable
Additional to ability of selecting Calculation Method, Source, plotting along with MACD, there are few other option that allows users to customize the MACD-X indicator
Lengths are configurable, default values are set as 12, 26, 9 respectively for fast, slow and smoothing length. Setting lengths to 8,21,5 respectively Is worth checking, slower length moving averages will lead to less lag and earlier reaction to price actions but yet requires a caution and back testing before applying
Highlight the area between MACD-X Line and Signal-X Line, with colors emphasising the direction
Label can be added to display Calculation Method, Source and Length settings, the aim of this label is to server only as a reminder to trades to be aware of settings while they are occupied with charts, analysis etc.
Here comes another question, which is of more importance having the reminder or having the indicators with multi timeframe feature? Build-in Multi Time Frame features of Pine is not supported when labels and lines introduced in the script, there are other methods but brings complexity. To be studied further, this version will be with labels for time being.
Epilogue
MACD-X is an alternative variant of MACD, the insight/signals provided by MACD are also applicable to MACD-X with early and clear warnings for the changes in the trend.
If MACD is essential to your analysis, then it is my guess that after using the MACD-X for a while and familiarizing yourself with its unique character and personality, you will make it an inseparable companion to other indicators in your charts.
The various signals generated by MACD/MACD-X are easily interpreted and very few indicators in technical analysis have proved to be more reliable than the MACD, and this relatively simple indicator can quickly be incorporated into any short-term trading strategy
Disclaimer : Trading success is all about following your trading strategy and the indicators should fit within your trading strategy, and not to be traded upon solely
The script is for informational and educational purposes only. Use of the script does not constitutes professional and/or financial advice. You alone the sole responsibility of evaluating the script output and risks associated with the use of the script. In exchange for using the script, you agree not to hold dgtrd TradingView user liable for any possible claim for damages arising from any decision you make based on use of the script
EulerMethod: DeltaEN
Shows the Integral Volume Delta (IVD)
It is a detailed OBV. Each bar sums up the volume for bars of a shorter timeframe.
For example, inside a 1M bar, every 12h bar is added up, and inside a 1h bar, every 1min bar is added. Thus, a conditional volume delta inside the bar is obtained.
The indicator for each bar shows the volume of purchases (positive), sales (negative) and the difference — IVD
The delta histogram is thicker than the volume histograms
Settings detalisation
M — 6 hours, 12 hours and 1 day for the M timeframe (720 by default)
W — 4 hours, 6 hours and 12 hours for the W timeframe (240 by default)
D — 30 minutes, 1 hour and 2 hours for the D timeframe (60 by default)
H — 1 minute, 5 minutes and 15 minutes for timeframes [1h, D) (default is 1)
For timeframes of 15m and less, the calculation is carried out by minute bars
VSA mode
The classic OBV adds volume to the cumulative sum under the condition Сlose (n) > Close (n-1) and subtracts it under the condition Close (n) < Close (n-1)
When VSA mode is disabled, all volumes are summed up under these conditions.
When the VSA approximation is turned on, the volume per bar of detail is divided by the factor (Close - Low) / (High - Low)
That is, it takes into account the spread per bar and closing relative to the spread. VSA is enabled by default
A/D mode
Shows the cumulative Accumulation / Distribution Index
The delta of the detail bar is multiplied by (High + Low + Close) / 3 bars, the result is added to the cumulative sum
No additional price conversions required due to integral summation
Index line view is customizable
EM Delta does not receive intermediate values in real time.
To see the result, wait until the bar closes or switch to a smaller timeframe
RU
Показывает Интегральную Дельту Объёма (ИДО)
Представляет собой детализированный OBV. В каждом баре суммируется объём за бары меньшего таймфрейма.
Например, внутри 1М-бара суммируется каждый 12h-бар, а внутри 1h — каждый 1m-бар. Таким образом получается условная дельта объёма внутри бара
Индикатор на каждый бар показывает объём покупок (положительный), объём продаж (отрицательный) и разницу — ИДО
Гистограмма дельты толще гистограмм объёмов
Настройки детализации внутри бара
M — 6 часов, 12 часов и 1 день для таймфрейма M (по-умолчанию 720)
W — 4 часа, 6 часов и 12 часов для таймфрейма W (по-умолчанию 240)
D — 30 минут, 1 час и 2 часа для таймфрейма D (по-умолчанию 60)
H — 1 минута, 5 минут и 15 минут для таймфреймов [1h, D) (по-умолчанию 1)
Для таймфреймов 15m и меньше расчёт ведётся по минутным барам
Режим VSA
Классический OBV прибавляет объём к кумулятивной сумме при условии Сlose(n) > Close(n-1) и отнимает при условии Close(n) < Close(n-1)
При отключении режима VSA все объёмы суммируются по этим условиям
При включённой VSA-аппроксимации объём за бар детализации делится по фактору (Close - Low) / (High - Low)
То есть учитывает спред за бар и закрытие относительно спреда. По-умолчанию режим VSA включен
Режим A/D
Показывает кумулятивный индекс Накопления/Распределения
Дельта бара детализации умножается на (High + Low + Close) / 3 бара, результат прибавляется к кумулятивной сумме
Дополнительные преобразования цены не требуются ввиду интегрального суммирования
Вид линии индекса настраивается
EM Delta не получает промежуточные значения в реальном времени.
Чтобы увидеть результат, дождитесь закрытия бара или перейдите на меньший таймфрейм
Pivot Point Monthly - bitcoin by Simon-RoseMonthly Version:
I have written 3 Indicators because i couldn't find what i was looking for in the library, so you can turn each one on and off individually for better visibility.
This are Daily, Weekly and Monthly Pivot Points with their Resistance and Support Points
and also on the Daily with the range between them.
I will also publish some Ideas to show you how to use them if you are not familiar with the traditional pivot points strategy already.
Unlike the usually 3 support & resistances i added 4 of them, specifically for trading bitcoin (on traditional markets this level of volatility usually never gets touched)
Here you can see which lines are what for reference, as the Feature to label lines is missing in Pinescript (if you have a workaround pls tell me ;) )
This is the basic calculation used :
PP = (xHigh+xLow+xClose) / 3
R1 = vPP+(vPP-Low)
R2 = vPP + (High - Low)
R3 = xHigh + 2 * (vPP - Low)
R4 = xHigh + 3 * (vPP - Low)
S1 = vPP-(High - vPP)
S2 = vPP - (High - Low)
S3 = xLow - 2 * (High - PP)
S4 = xLow - 3 * (High - PP)
If you have any questions or suggestions pls write me :)
Happy trading
Cheers
Daily Version:
Weekly Version:
Pivot Points Weekly - bitcoin by Simon-RoseWeekly Version:
I have written 3 Indicators because i couldn't find what i was looking for in the library, so you can turn each one on and off individually for better visibility.
This are Daily, Weekly and Monthly Pivot Points with their Resistance and Support Points
and also on the Daily with the range between them.
I will also publish some Ideas to show you how to use them if you are not familiar with the traditional pivot points strategy already.
Unlike the usually 3 support & resistances i added 4 of them, specifically for trading bitcoin (on traditional markets this level of volatility usually never gets touched)
Here you can see which lines are what for reference, as the Feature to label lines is missing in Pinescript (if you have a workaround pls tell me ;) )
This is the basic calculation used :
PP = (xHigh+xLow+xClose) / 3
R1 = vPP+(vPP-Low)
R2 = vPP + (High - Low)
R3 = xHigh + 2 * (vPP - Low)
R4 = xHigh + 3 * (vPP - Low)
S1 = vPP-(High - vPP)
S2 = vPP - (High - Low)
S3 = xLow - 2 * (High - PP)
S4 = xLow - 3 * (High - PP)
If you have any questions or suggestions pls write me :)
Happy trading
Cheers
Daily Version:
Monthly Version:
Pivot Points Daily - bitcoin by Simon-RoseDaily Version:
I have written 3 Indicators because i couldn't find what i was looking for in the library, so you can turn each one on and off individually for better visibility.
This are Daily, Weekly and Monthly Pivot Points with their Resistance and Support Points
and also on the Daily with the range between them.
I will also publish some Ideas to show you how to use them if you are not familiar with the traditional pivot points strategy already.
Unlike the usually 3 support & resistances i added 4 of them, specifically for trading bitcoin (on traditional markets this level of volatility usually never gets touched)
Here you can see which lines are what for reference, as the Feature to label lines is missing in Pinescript (if you have a workaround pls tell me ;) )
This is the basic calculation used :
PP = (xHigh+xLow+xClose) / 3
R1 = vPP+(vPP-Low)
R2 = vPP + (High - Low)
R3 = xHigh + 2 * (vPP - Low)
R4 = xHigh + 3 * (vPP - Low)
S1 = vPP-(High - vPP)
S2 = vPP - (High - Low)
S3 = xLow - 2 * (High - PP)
S4 = xLow - 3 * (High - PP)
If you have any questions or suggestions pls write me :)
Happy trading
Cheers
Weekly Version:
Monthly Version:
Binque's Multi-Moving Average Binque's Multi-Moving Average - One indicator with four simple moving average and four exponential moving averages, plus as a bonus a Day High moving average and a Day Low Moving Average.
Simple Moving Average or MA(14), MA(50), MA(100) and MA(200) all in one indicator
Exponential Moving Average or EMA(8), EMA(14), EMA(20) and EMA(33) all in one indicator
Day High Moving Average - Tracks the Daily High versus most moving averages track the daily close.
Day Low Moving Average - Tracks the Daily Low versus most moving average track the daily close.
To Disable moving averages, Set the color to the chart background and then set the length to 1 and uncheck.
I Use the Daily High Moving Average to track upward resistance in a stock movement for Swing Trading.
I Use the Daily Low Moving Average to track my trailing stop in a stock movement for Swing Trading.
Math by Thomas Liquidity PoolDescription
Math by Thomas Liquidity Pool is a TradingView indicator designed to visually identify potential liquidity pools on the chart by detecting areas where price forms clusters of equal highs or equal lows.
Bullish Liquidity Pools (Green Boxes): Marked below price where two adjacent candles have similar lows within a specified difference, indicating potential demand zones or stop loss clusters below support.
Bearish Liquidity Pools (Red Boxes): Marked above price where two adjacent candles have similar highs within the difference threshold, indicating potential supply zones or stop loss clusters above resistance.
This tool helps traders spot areas where smart money might hunt stop losses or where price is likely to react, providing valuable insight for trade entries, exits, and risk management.
Features:
Adjustable box height (vertical range) in points.
Adjustable maximum difference threshold between candle highs/lows to consider them equal.
Boxes automatically extend forward for visibility and delete when price sweeps through or after a defined lifetime.
Separate visual zones for bullish and bearish liquidity with customizable colors.
How to Use
Add the Indicator to your chart (preferably on instruments like Nifty where point-based thresholds are meaningful).
Adjust Inputs:
Box Height: Set the vertical size of the liquidity zones (default 15 points).
Max Difference Between Highs/Lows: Set the max price difference to consider two candle highs or lows as “equal” (default 10 points).
Box Lifetime: How many bars the box stays visible if not swept (default 120 bars).
Interpret Boxes:
Green Boxes (Bullish Liquidity Pools): Areas of potential demand and stop loss clusters below price. Watch for price bounces or accumulation near these zones.
Red Boxes (Bearish Liquidity Pools): Areas of potential supply and stop loss clusters above price. Watch for price rejections or distribution near these zones.
Trading Strategy Tips:
Use these zones to anticipate where stop loss hunting or liquidity sweeps may occur.
Combine with your Order Block, Fair Value Gap, and Market Structure tools for higher probability setups.
Manage risk by avoiding entries into price regions just before large liquidity pools get swept.
Automatic Cleanup:
Boxes delete automatically once price breaks above (for bearish zones) or below (for bullish zones) the zone or after the set lifetime.
Dr Avinash Talele momentum indicaterTrend and Volatility Metrics
EMA10, EMA20, EMA50:
Show the percentage distance of the current price from the 10, 20, and 50-period Exponential Moving Averages.
Positive values indicate the price is above the moving average (bullish momentum).
Negative values indicate the price is below the moving average (bearish or corrective phase).
Use: Helps traders spot if a stock is extended or pulling back to support.
RVol (Relative Volume):
Compares current volume to the 20-day average.
Positive values mean higher-than-average trading activity (potential institutional interest).
Negative values mean lower activity (less conviction).
Use: High RVol often precedes strong moves.
ADR (Average Daily Range):
Shows the average daily price movement as a percentage.
Use: Higher ADR = more volatility = more trading opportunities.
50D Avg. Vol & 50D Avg. Vol ₹:
The 50-day average volume (in millions) and value traded (in crores).
Use: Confirms liquidity and suitability for larger trades.
ROC (Rate of Change) Section
1W, 1M, 3M, 6M, 12M:
Show the percentage price change over the last 1 week, 1 month, 3 months, 6 months, and 12 months.
Positive values (green) = uptrend, Negative values (red) = downtrend.
Use: Quickly see if the stock is gaining or losing momentum over different timeframes.
Momentum Section
1M, 3M, 6M:
Show the percentage gain from the lowest price in the last 1, 3, and 6 months.
Use: Measures how much the stock has bounced from recent lows, helping find strong rebounds or new leaders.
52-Week High/Low Section
From 52WH / From 52WL:
Show how far the current price is from its 52-week high and low, as a percentage.
Closer to 52WH = strong uptrend; Closer to 52WL = possible value or turnaround setup.
Use: Helps traders identify stocks breaking out to new highs or rebounding off lows.
U/D Ratio
U/D Ratio:
The ratio of up-volume to down-volume over the last 50 days.
Above 1 = more buying volume (bullish), Below 1 = more selling volume (bearish).
Use: Confirms accumulation or distribution.
How This Table Helps Analysts and Traders
Instant Trend Assessment:
With EMA distances and ROC, analysts can instantly see if the stock is trending, consolidating, or reversing.
Momentum Confirmation:
ROC and Momentum sections highlight stocks with strong recent moves, ideal for momentum and breakout traders.
Liquidity and Volatility Check:
Volume and ADR ensure the stock is tradable and has enough price movement to justify a trade.
Relative Positioning:
52-week high/low stats show whether the stock is near breakout levels or potential reversal zones.
Volume Confirmation:
RVol and U/D ratio help confirm if moves are backed by real buying/selling interest.
Actionable Insights:
By combining these metrics, traders can filter for stocks with strong trends, robust momentum, and institutional backing—ideal for swing, position, or even intraday trading.
Prev Day High/Low - RTH OnlyThis indicator displays the previous day’s Regular Trading Hours (RTH) high and low levels on your chart, but only during the next day’s RTH session — keeping your charts clean while highlighting the most relevant price zones.
🔧 Features:
RTH Timing: 09:30 to 16:00 (New York time)
Auto-Detection: Automatically tracks the high and low of each RTH session
Next-Day Visibility: Lines are only shown during the following day’s RTH session
Minimal Chart Clutter: Levels disappear after the session ends, keeping focus on what's relevant
Clear Labels: Optional “Prev High” and “Prev Low” markers at market open
📊 Use Case:
Perfect for intraday and 0DTE options traders who rely on prior session key levels for:
Breakout trades
Reversal setups
Support/resistance confluence
These levels are often respected by institutions and algo flows, making them highly actionable when approached in the next RTH session.
🧠 Why This Matters:
Many traders overpopulate their charts with persistent support/resistance lines. This script keeps only what’s essential — the previous day’s RTH range — and only when it matters most: the following day’s active market hours.